|
|
|
|
|
|
|
You can specify a return value. The absence of a return value means that the method is a sub. Otherwise, it is a function. |
|
|
|
|
|
|
|
|
You can specify that the method is a friend. This means that it is available to all modules in the project but not to those modules outside the project. |
|
|
|
|
|
|
|
|
You can specify whether the current method should be the default method. Thus, if you use the class variable in code as you would a function or a sub, the Visual Basic compiler will use the default method to provide the requested service. |
|
|
|
|
|
|
|
|
There is no Prop Declaration column. |
|
|
|
|
|
|
|
|
The Events tab shows all the events associated with the current class or collection. Because the creation and maintenance of events is the same as that of methods, double-clicking the Events tab opens the Method Builder as well. The difference between a method and event, as far as Class Builder is concerned, is that an event does not require a data type. Finally, the All tab combines the specifications for every member of the current class into one convenient list. |
|
|
|
|
|
|
|
|
Tip To convert a class in the Object Model pane into a collection, right-click on the class, and choose Set As Collection. To convert back to a class, right-click on the collection, and choose Set As Class. |
|
|
|
|
|
|
|
|
|
Collections and Aggregations of Objects |
|
|
|
|
|
|
|
|
In the earlier discussion of Class Builder, you came across the word collection and probably wondered what it meant. The word collection is synonymous with the expression object collection. An object collection is, well, a collection of objects. It is a list of objects, you might say. By that, you should understand that a collection is, itself, an object. This object holds references to other objects and has methods for adding, accessing, and deleting objects within it. You might view a collection as an inventory of related objects. For instance, borrowing from the banking theme, a collection class AllAccounts might contain a reference to all active accounts that a teller has to process at the end of a day. In code, you would simply iterate through each object reference until the teller processed the last one. Then you could store each object in a database, either as relational records or objects. |
|
|
|
|
|
|
|
|
An aggregation of objects is an object that contains other objects, but not in the sense of a collection. In Visual Basic, a collection is a nice object mechanism for manipulating the similarly named methods and properties of objects. There is no sense of the purpose for using objects in the collection, other than for bundling them into a collection for easy access. With aggregation, though, there is a reason that the aggregate object has other |
|
|
|
|
|